<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="copyright" content="www.apicloud.com" />
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<title>修改密码</title>
<link rel="stylesheet" type="text/css" href="../css/api.css" />
<style>
    body {
        display: -webkit-box;
        -webkit-box-orient: vertical;
    } 
    #main{ 
            background-color: #F9F9F9; 
        }
     
	.clearfix:after{
	    content: '';
	    display: block;
	    clear: both;
	}
    .btn-group{
        margin-top: 0.75em;
    }
    .btn-box-left{
        width: 49%;
    }
    .btn-box-right{
        width: 49%;
    }
    .btnGo{
        display: block;
        height: 37px;
        border-radius: 6px;
        line-height: 37px;
        text-align: center;
    }
    .log{
        background: url(../image/button_red_bg_nor.png) center center no-repeat;
        background-size: 100% 100%;
        border: 1px solid #850909;
        color: #FFF;
    }
    .log:active,.log.tap-active{
        background: url(../image/button_red_bg_press.png) center center no-repeat;
        background-size: 100% 100%;
    }
    .reg{
        background: url(../image/button_white_bg_nor.png) center center no-repeat;
        background-size: 100% 100%;
        border: 1px solid #C8C8C8;
        color: #909090;
    }
    .reg:active,.reg.tap-active{
        background: url(../image/button_white_bg_pressed.png) center center no-repeat;
        background-size: 100% 100%;
    } 
    .pull-left{
	    float: left;
	}
	.pull-right{
	    float: right;
	}
	.input-wrap{
     	padding: 20px 10px 0;
     }
     .input-wrap{
	    padding: 20px 10px; position: relative;
	}
	.txt{
	    border: 1px solid #e6e6e6; border-radius: 6px; padding: 10px;
	    width: 100%; outline: none;
	    -webkit-box-sizing: border-box;
	    box-sizing: border-box;
	} 
</style>
</head>
<body> 
	<div id="main">
        	<div class="input-wrap">
        		<textarea id="newsComment" class="txt" style="height:7em" placeholder="请文明发言"></textarea> 
            </div> 
            <div class="btn-group clearfix">
                <div class="btn-box-left pull-left">
                    <a class="btnGo reg" tapmode="tap-active" onclick="api.closeWin()">取消</a>
                </div>
                <div class="btn-box-right pull-right">
                    <a class="btnGo log" tapmode="tap-active" onclick="goto_comitInfoFun()">提交</a>
                </div>
            </div> 
        </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>  
<script type="text/javascript" src="../script/alpenlicebe.js"></script>   
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hashes.min.js"></script> 
<script type="text/javascript">
   apiready = function() {  
           
    }; 
	function goto_comitInfoFun() { 
		var infoID=api.pageParam.infoID;
		var hotID=api.pageParam.hotID;
		if(''==hotID||undefined==hotID||null==hotID){
    		api.alert({title:'系统提示',msg:'参数错误'});
			return;
    	}
    	var msg = $api.byId('newsComment').value; 
    	if(''==msg){
    		api.alert({title:'系统提示',msg:'请输入您要发表的评论内容'});
			return;
    	} 
    	api.showProgress({
		    style: 'default',
		    animationType: 'fade',
		    title: '',
		    text: '',
		    modal: false
		});
		
		var MD5 = new Hashes.MD5;   
       	var access_token = Alpe_getLocalStorge("access_token");                     
       	var admin_id = Alpe_getLocalStorge("admin_id"); 
       	var sign = MD5.hex(access_token+admin_id+infoID+'datas/GetSpecialSubmitMsg'+hotID+'1.0syjqingbao');
       	var url = Alpe_ApiUrl+'r=datas/GetSpecialSubmitMsg&access_token='+access_token+'&admin_id='+admin_id
       		+'&newsID='+infoID+'&special_id='+hotID+'&message='+msg
       		+'&v=1.0&sign='+sign;
       	api.ajax({
	         url: url,
	         method: 'get',
	         cache: false,
	         timeout: 30,			
	         dataType: 'json'
       	}, function(ret, err){
			if (ret) {	 
				api.toast({
	         		msg: ret.message,
             		duration:2000,
                	location: 'middle'
           		}); 
           		$api.byId('newsComment').value='';
		  		api.hideProgress(); 
			}else{
				api.alert({title:'系统提示',msg:'错误码：'+err.code+'；错误信息：'+err.msg+'网络状态码：'+err.statusCode});
				api.hideProgress();
			} 
   		});		
	} 
</script>
</html>